import request from "../request.js"



// 后台形成订单,并返回订单id.
function requestPreOrder(data){
	return request({
		method:'post',
		url:`/lejuClient/order/addPreOrder`,
		data
	})
}

// 获取订单信息
function requestOrderInfo(orderId){
	return request({
		url:`/lejuClient/order/getPreOrderById/${orderId}`,
	})
}


// 提交确认订单
function requestConfirmOrder(data){
	return request({
		method:'post',
		url:`/lejuClient/order/addConfirmOrder`,
		data
	})
}


// 确认付款
function requestPayOrder(data){
	return request({
		method:'post',
		url:`/lejuClient/order/payConfirm`,
		data
	})
}

// 获取订单列表
function requestGetOrder(data){
	return request({
		url:`/lejuClient/order/findAllOrders`,
		data
	})
}

// 取消订单
function requestCancelOrder(orderId){
	return request({
		method:'post',
		url:`/lejuClient/order/cancelOrder/${orderId}`,
	})
}

// 确认收货
function requestGetGoods(data){
	return request({
		method:'post',
		url:`/lejuClient/order/receiveDone`,
		data
	})
}

// 退单列表界面
function requestGetReturnList(data){
	return request({
		url:`/lejuClient/orderReturn/orderReturnApplys`,
		data
	})
}

// 申请退单
function requestOrderReturnApply(data){
	return request({
		method:'post',
		url:`/lejuClient/orderReturn/addOrderReturnApply`,
		data
	})
}


// 获取退单公司地址

function requestCompanyAddrss(data){
	return request({
		url:`/lejuClient/orderReturn/getCompanyAddrss`,
		data
	})
}

// 查看退单信息

function requestGetReturnInfo(id){
	return request({
		url:`/lejuClient/orderReturn/${id}`,
	})
}

export {
	requestPreOrder,
	requestOrderInfo,
	requestConfirmOrder,
	requestPayOrder,
	requestGetOrder,
	requestCancelOrder,
	requestGetGoods,
	requestGetReturnList,
	requestOrderReturnApply,
	requestCompanyAddrss,
	requestGetReturnInfo
}